var Sequelize = require('sequelize');
var {sequelize} = require('../sequelize.js');

/**
 * 新闻模块
 * 字段定义
 * id int 主键 自增长
 * title string 新闻标题 必填
 * content string 新闻内容
 * category int 所属分类
 * create_at timestamp 新建时间
 */

var news = sequelize.define('news',{
    id: {
        type: Sequelize.BIGINT(20),
        primaryKey: true,
        allowNull: false,
        unique: true,
        autoIncrement: true
    },
    title: Sequelize.STRING(255), // 标题
    content: Sequelize.STRING(255), // 内容
    create_by: Sequelize.STRING(255), // 作者
    category:Sequelize.BIGINT(20), //分类
    create_at:Sequelize.DATE //时间
},{
    timestamps: false,
    freezeTableName: true
});

module.exports = news;